#include <iostream>
#define N 100

using namespace std;

void swap(int array[], int size){
int i,j, aux;
i=0;
j=size-1;
while (i<j){
    aux=array[i];
    array[i]=array[j];
    array[j]=aux;
    ++i;
    --j;}
}

void printVector(int array[], int size){
for (int i=0; i<size; i++){
    cout<<array[i];}
	cout<<"\n";
}

int main()
{
int i, j;
int k=0;
int size=1;
int carry=0;
int array[N];

for(i=0;i<N; i++)
    array[i]=0;
    array[0]=1;
while (k<50){
    for(j=0; j<size; ++j){
        i=array[j]*2;
			if(i>9){
				array[j]=i%10+carry;
				carry=i/10;}
			else{
				array[j]=i+carry;
				carry=0;}
			if(array[size-1]>4)
					++size;}
                ++k;}
swap(array, size);
cout<<"2 at the power 50 is: ";
printVector(array, size);

return 0;
}
